﻿#include<iostream>
#include<ctime>

using namespace std;

int main() {
	time_t current = time(NULL);
	struct tm timer;
	localtime_s(&timer, &current);

	const char* wday_name[] = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };

	cout << "当前日期和时间是：" << timer.tm_year + 1900 << "年" << timer.tm_mon + 1 << "月" << timer.tm_mday << "日（"
		<< wday_name[timer.tm_wday] << "）" << timer.tm_hour << "时" << timer.tm_min << "分" << timer.tm_sec << "秒\n";

	cin.get();
}